package com.syxp.pda.core.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeFormatUtil {

	private static DateFormat timeDF = new SimpleDateFormat("HH:mm:ss") ;
	
	private static DateFormat dateDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") ;
	
	private static DateFormat datedF = new SimpleDateFormat("yyyy-MM-dd") ;
	
	public static String formatWorkTime(Date date) {

		return timeDF.format(date) ;
	}
	
	public static String formatDate(Date date) {
		return dateDF.format(date) ;
	}
	
	public static Date parseDate(String temp) throws ParseException {
		return dateDF.parse(temp) ;
	}
	
	public static Date parseTime(String temp) throws ParseException {
		return timeDF.parse(temp) ;
	}
	
	public static String formatDateF(Date date) {
		return datedF.format(date) ;
	}
	
	public static Date parseDateF(String temp) throws ParseException{
		return datedF.parse(temp) ;
	}
}
